home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / bink2adp.zip / Bink2Adept.CMD next >
OS/2 REXX Batch file  |  1997-07-16  |  22KB  |  692 lines

  1. /* ********************************** */
  2. /*                                    */
  3. /* Binkley - Adept Outbound Converter */
  4. /*                 by BK              */
  5. /* ********************************** */
  6.  
  7. /* NOTE:
  8.  
  9. This rexx script will convert following files:
  10.  
  11.     *.HLO  = Hold flavor (PKTs and/or file attaches) -> H.*
  12.     *.FLO  = File Attach -> N.*
  13.     *.CLO  = File Attach CRASH flavor -> C.*
  14.     *.REQ  = File Request or Update Request -> R.*
  15.  
  16. Files listed below are Netmails. They will be renamed and directly zipped into A.* files
  17. whiles corresponding flavor files are created
  18.  
  19. *.CUT  = Netmail crash flag -> A.* & C.*
  20. *.OUT  = Netmail attach or request flag -> A.* & N.*
  21. *.HUT  = Netmail hold flag -> A.* & H.*
  22.  
  23. My setup:
  24. I ve setup FASTECHO 1.45 and 1.46. Every node configuration is as normal as you need, but 
  25. DO NOT archieve mails for any node! SET ".PKT" !!!!!!...!!!
  26.  
  27. You also need a small batch like this:
  28.  
  29.  
  30. fastech2 scan         -> scan for outbound mail
  31. fastech2 pack -p      -> pack outbound netmail
  32. bink2adept.cmd        -> mhh .. play quake? .. sorry no netx/ipx included
  33.  
  34.  
  35. If you want to make any changes .. feel free .. but lemme know what and why!
  36.  
  37.  
  38. Just change the pathes to match your setup!
  39. */
  40.  
  41.  
  42. /* SETUP */
  43.  
  44. adept_out="c:\adept\mailer\outbound_mail\"          /* Adept Outbound Path */
  45. bink_out="c:\adept\mailer\outbound_mail\bink\"      /* Binkley styled Outbound Path */
  46. default_domain="FIDONET"                            /* default domain */
  47. default_ZONE=2                                      /* your default zone number */
  48. default_point=0                                     /* default point number */
  49.  
  50. /* ******* */
  51.  
  52. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  53. call SysLoadFuncs
  54.  
  55. tmp=syscls()
  56. temp=0
  57. path_bink=translate(filespec("P", bink_out))
  58.  
  59. hold=adept_out||"*.HLO"         /* HOLD flavors */
  60. crash=adept_out||"*.CLO"        /* ATTACH & CRASH */
  61. attach=adept_out||"*.FLO"       /* ATTACH normal */
  62. request=adept_out||"*.REQ"      /* REQUEST & UPDATE REQUEST */
  63.  
  64. OUT_NM=adept_out||"*.OUT"       /* NetMail */
  65. HLD_NM=adept_out||"*.HUT"       /* HOLD NetMail */
  66. CR_NM=adept_out||"*.CUT"        /* CRASH NetMail without flavor */
  67.  
  68. call SysFileTree hold, "hold_array.", "FS"
  69. call SysFileTree crash, "crash_array.", "FS"
  70. call SysFileTree attach, "attach_array.", "FS"
  71. call SysFileTree request, "request_array.", "FS"
  72.  
  73. call SysFileTree OUT_NM, "out_nm_array.", "FS"
  74. call SysFileTree HLD_NM, "hld_NM_array.", "FS"
  75. call SysFileTree cr_nm, "cr_nm_array.", "FS"
  76.  
  77.  
  78.  
  79. /* HOLD PKT */
  80.  
  81. if hold_array.0 > 0 then do
  82.     do i=1 to hold_array.0
  83.         hold_name.i=strip(subword(hold_array.i, 5),"B")
  84.         domain_hold.i=default_domain                   /* set fido defaults */
  85.         zone_hold.i=default_zone
  86.         point_hold.i=default_point
  87.         path=translate(filespec("P", hold_name.i))
  88.  
  89.         if path\=path_bink then do                     /* if true either point or other domain */
  90.             path=strip(path, "T", "\")
  91.             last=lastpos("\", path)
  92.             last1=lastpos("\", path, last-1)
  93.             new_zone=substr(path, last1+1, (last-last1-1))
  94.             last2=lastpos(".", new_zone)            /* DOMAIN.ZONE dir? */
  95.             if last2\=0 then do
  96.                 new_end=substr(new_zone, last2+1)
  97.                 zone_hold.i=x2d(new_end)        /* get domain and zone */
  98.                 domain_hold.i=substr(new_zone, 1, last2-1)
  99.             end            
  100.             new_dir=substr(path, last+1)
  101.             last=lastpos(".", new_dir)
  102.             new_end=substr(new_dir, last+1)
  103.  
  104.             if new_end = "PNT" then do              /* Point -> get net/node.point */
  105.                net_hold.i=x2d(substr(new_dir,1,4))
  106.                node_hold.i=x2d(substr(new_dir,5,4))
  107.                point_hold.i=x2d(substr(filespec( "N", hold_name.i),5,4))
  108.             end
  109.             else do
  110.                 zone_hold.i=x2d(new_end)         /* Node -> get net/node.point */
  111.                 domain_hold.i=substr(new_dir, 1, last-1)
  112.                 net_hold.i=x2d(substr(filespec( "N", hold_name.i),1,4))
  113.                 node_hold.i=x2d(substr(filespec( "N", hold_name.i),5,4))
  114.             end
  115.         end
  116.         else do
  117.             net=FILESPEC("N", hold_name.i)
  118.             net=strip(substr(net,1,4),"B")
  119.              node=FILESPEC("N", hold_name.i)
  120.             node=strip(substr(node,5,4),"B")
  121.             net_hold.i=x2d(net)
  122.             node_hold.i=x2d(node)
  123.         end
  124.         hold_out.i="A."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  125.         hold_flavor.i="H."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  126.         say "   ***Creating Outbound "||filespec("N", hold_name.i)||" for "||hold_out.i||" HOLD flavor"
  127.         say ""
  128.     end
  129.  
  130.     do i=1 to hold_array.0
  131.         file=hold_name.i
  132.  
  133.         rc_open = STREAM( (file) , "C" , "OPEN" )
  134.         do while lines(file)
  135.             line=linein(file)
  136.             last=lastpos(".", line)
  137.             endung=translate(substr(line, last+1))
  138.             filesearch=adept_out||hold_flavor.i
  139.             call SysFileTree filesearch, "flavor.", "FS"
  140.             if endung="PKT" then do
  141.                 'ZIP.EXE -m -j 'adept_out||hold_out.i line
  142.                 if flavor.0=0 then do
  143.                     say "   *** Creating H-flavor"
  144.                     say ""
  145.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  146.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  147.                 end
  148.             end
  149.             else do
  150.                 if flavor.0=0 then do
  151.                     say "   *** Creating H-flavor for file attach"
  152.                     say ""
  153.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  154.                     ok=lineout(filesearch, line)
  155.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  156.                 end
  157.                 else do
  158.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  159.                     rc_seek = STREAM( (filesearch) , "C" , "SEEK <0" )
  160.                     ok=lineout(filesearch, line)
  161.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  162.  
  163.                 end
  164.             end
  165.  
  166.         end
  167.         rc_open = STREAM( (file) , "C" , "CLOSE" )
  168.         call Sysfiledelete(file)
  169.     end
  170. end
  171.  
  172. /* *.HUT */
  173.  
  174. if HLD_NM_array.0 > 0 then do
  175.     do i=1 to hld_nm_array.0
  176.         hld_nm_name.i=strip(subword(hld_nm_array.i, 5),"B")
  177.         domain_hold.i=default_domain
  178.         zone_hold.i=default_zone
  179.         point_hold.i=default_point
  180.         path=translate(filespec("P", hld_nm_name.i))
  181.         if path\=path_bink then do
  182.             path=strip(path, "T", "\")
  183.             last=lastpos("\", path)
  184.             last1=lastpos("\", path, last-1)
  185.             new_zone=substr(path, last1+1, (last-last1-1))
  186.             last2=lastpos(".", new_zone)
  187.             if last2\=0 then do
  188.                 new_end=substr(new_zone, last2+1)
  189.                 zone_hold.i=x2d(new_end)
  190.                 domain_hold.i=substr(new_zone, 1, last2-1)
  191.             end            
  192.             new_dir=substr(path, last+1)
  193.             last=lastpos(".", new_dir)
  194.             new_end=substr(new_dir, last+1)
  195.  
  196.             if new_end = "PNT" then do
  197.                net_hold.i=x2d(substr(new_dir,1,4))
  198.                node_hold.i=x2d(substr(new_dir,5,4))
  199.                point_hold.i=x2d(substr(filespec( "N", hld_nm_name.i),5,4))
  200.             end
  201.             else do
  202.                 zone_hold.i=x2d(new_end)
  203.                 domain_hold.i=substr(new_dir, 1, last-1)
  204.                 net_hold.i=x2d(substr(filespec( "N", hld_nm_name.i),1,4))
  205.                 node_hold.i=x2d(substr(filespec( "N", hld_nm_name.i),5,4))
  206.             end
  207.         end
  208.         else do
  209.             net=FILESPEC("N", hld_nm_name.i)
  210.             net=strip(substr(net,1,4),"B")
  211.              node=FILESPEC("N", hld_nm_name.i)
  212.             node=strip(substr(node,5,4),"B")
  213.             net_hold.i=x2d(net)
  214.             node_hold.i=x2d(node)
  215.         end
  216.         hld_nm_out.i="A."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  217.         hld_nm_flavor.i="H."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  218.         say "   ***Creating Outbound "||filespec("N", hld_nm_name.i)||" for "||hld_nm_out.i||" HOLD flavor"
  219.         say ""
  220.     end
  221.  
  222.     do i=1 to hld_nm_array.0
  223.         file=hld_nm_name.i
  224.         filesearch=adept_out||hld_nm_flavor.i
  225.         call SysFileTree filesearch, "flavor.", "FS"
  226.         new_name=pkt_name()
  227.         '@ren 'hld_nm_name.i new_name
  228.         '@ZIP.EXE -m -j 'adept_out||hld_nm_out.i path||'\'||new_name
  229.         if flavor.0=0 then do
  230.             say "   *** Creating H-flavor"
  231.             say ""
  232.             rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  233.             rc_close = STREAM( (filesearch) , "C" , "CLOSE" )
  234.         end
  235.     end
  236. end
  237.  
  238.  
  239. /* *.OUT */
  240.  
  241. if OUT_NM_array.0 > 0 then do
  242.     do i=1 to OUT_NM_array.0
  243.         OUT_NM_name.i=strip(subword(OUT_NM_array.i, 5),"B")
  244.         domain_hold.i=default_domain
  245.         zone_hold.i=default_zone
  246.         point_hold.i=default_point
  247.         path=translate(filespec("P", OUT_NM_name.i))
  248.         if path\=path_bink then do
  249.             path=strip(path, "T", "\")
  250.             last=lastpos("\", path)
  251.             last1=lastpos("\", path, last-1)
  252.             new_zone=substr(path, last1+1, (last-last1-1))
  253.             last2=lastpos(".", new_zone)
  254.             if last2\=0 then do
  255.                 new_end=substr(new_zone, last2+1)
  256.                 zone_hold.i=x2d(new_end)
  257.                 domain_hold.i=substr(new_zone, 1, last2-1)
  258.             end            
  259.             new_dir=substr(path, last+1)
  260.             last=lastpos(".", new_dir)
  261.             new_end=substr(new_dir, last+1)
  262.  
  263.             if new_end = "PNT" then do
  264.                net_hold.i=x2d(substr(new_dir,1,4))
  265.                node_hold.i=x2d(substr(new_dir,5,4))
  266.                point_hold.i=x2d(substr(filespec( "N", OUT_NM_name.i),5,4))
  267.             end
  268.             else do
  269.                 zone_hold.i=x2d(new_end)
  270.                 domain_hold.i=substr(new_dir, 1, last-1)
  271.                 net_hold.i=x2d(substr(filespec( "N", OUT_NM_name.i),1,4))
  272.                 node_hold.i=x2d(substr(filespec( "N", OUT_NM_name.i),5,4))
  273.             end
  274.         end
  275.         else do
  276.             net=FILESPEC("N", OUT_NM_name.i)
  277.             net=strip(substr(net,1,4),"B")
  278.              node=FILESPEC("N", OUT_NM_name.i)
  279.             node=strip(substr(node,5,4),"B")
  280.             net_hold.i=x2d(net)
  281.             node_hold.i=x2d(node)
  282.         end
  283.         OUT_NM_out.i="A."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  284.         OUT_NM_flavor.i="H."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  285.         say "   ***Creating Outbound "||filespec("N", OUT_NM_name.i)||" for "||OUT_NM_out.i||" HOLD flavor"
  286.         say ""
  287.     end
  288.  
  289.     do i=1 to OUT_NM_array.0
  290.         file=OUT_NM_name.i
  291.         filesearch=adept_out||OUT_NM_flavor.i
  292.         call SysFileTree filesearch, "flavor.", "FS"
  293.         new_name=pkt_name()
  294.         '@ren 'out_nm_name.i new_name
  295.         '@ZIP.EXE -m -j 'adept_out||out_nm_out.i path||'\'||new_name
  296.         if flavor.0=0 then do
  297.             say "   *** Creating H-flavor"
  298.             say ""
  299.             rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  300.             rc_close = STREAM( (filesearch) , "C" , "CLOSE" )
  301.         end
  302.     end
  303. end
  304.  
  305.  
  306. /* CRASH PKT */
  307.  
  308. if crash_array.0 > 0 then do
  309.     do i=1 to crash_array.0
  310.         crash_name.i=strip(subword(crash_array.i, 5),"B")
  311.         domain_hold.i=default_domain
  312.         zone_hold.i=default_zone
  313.         point_hold.i=default_point
  314.         path=translate(filespec("P", crash_name.i))
  315.         if path\=path_bink then do
  316.             path=strip(path, "T", "\")
  317.             last=lastpos("\", path)
  318.             last1=lastpos("\", path, last-1)
  319.             new_zone=substr(path, last1+1, (last-last1-1))
  320.             last2=lastpos(".", new_zone)
  321.             if last2\=0 then do
  322.                 new_end=substr(new_zone, last2+1)
  323.                 zone_hold.i=x2d(new_end)
  324.                 domain_hold.i=substr(new_zone, 1, last2-1)
  325.             end            
  326.             new_dir=substr(path, last+1)
  327.             last=lastpos(".", new_dir)
  328.             new_end=substr(new_dir, last+1)
  329.  
  330.             if new_end = "PNT" then do
  331.                net_hold.i=x2d(substr(new_dir,1,4))
  332.                node_hold.i=x2d(substr(new_dir,5,4))
  333.                point_hold.i=x2d(substr(filespec( "N", crash_name.i),5,4))
  334.             end
  335.             else do
  336.                 zone_hold.i=x2d(new_end)
  337.                 domain_hold.i=substr(new_dir, 1, last-1)
  338.                 net_hold.i=x2d(substr(filespec( "N", crash_name.i),1,4))
  339.                 node_hold.i=x2d(substr(filespec( "N", crash_name.i),5,4))
  340.             end
  341.         end
  342.         else do
  343.             net=FILESPEC("N", crash_name.i)
  344.             net=strip(substr(net,1,4),"B")
  345.              node=FILESPEC("N", crash_name.i)
  346.             node=strip(substr(node,5,4),"B")
  347.             net_hold.i=x2d(net)
  348.             node_hold.i=x2d(node)
  349.         end
  350.         crash_out.i="A."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  351.         crash_flavor.i="C."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  352.         say "   ***Creating Outbound "||filespec("N", crash_name.i)||" for "||crash_out.i||" CRASH flavor"
  353.         say ""
  354.     end
  355.  
  356.     do i=1 to crash_array.0
  357.         file=crash_name.i
  358.  
  359.         rc_open = STREAM( (file) , "C" , "OPEN" )
  360.         do while lines(file)
  361.             line=linein(file)
  362.             last=lastpos(".", line)
  363.             endung=translate(substr(line, last+1))
  364.             filesearch=adept_out||crash_flavor.i
  365.             call SysFileTree filesearch, "flavor.", "FS"
  366.             if endung="PKT" then do
  367.                 'ZIP.EXE -m -j 'adept_out||crash_out.i line
  368.                 if flavor.0=0 then do
  369.                     say "   *** Creating C-flavor"
  370.                     say ""
  371.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  372.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  373.                 end
  374.             end
  375.             else do
  376.                 if flavor.0=0 then do
  377.                     say "   *** Creating C-flavor for file attach"
  378.                     say ""
  379.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  380.                     ok=lineout(filesearch, line)
  381.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  382.                 end
  383.                 else do
  384.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  385.                     rc_seek = STREAM( (filesearch) , "C" , "SEEK <0" )
  386.                     ok=lineout(filesearch, line)
  387.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  388.  
  389.                 end
  390.             end
  391.         end
  392.         rc_open = STREAM( (file) , "C" , "CLOSE" )
  393.         call Sysfiledelete(file)
  394.     end
  395. end
  396.  
  397.  
  398. /* *.CUT */
  399.  
  400. if CR_NM_array.0 > 0 then do
  401.     do i=1 to CR_NM_array.0
  402.         CR_NM_name.i=strip(subword(CR_NM_array.i, 5),"B")
  403.         domain_hold.i=default_domain
  404.         zone_hold.i=default_zone
  405.         point_hold.i=default_point
  406.         path=translate(filespec("P", CR_NM_name.i))
  407.         if path\=path_bink then do
  408.             path=strip(path, "T", "\")
  409.             last=lastpos("\", path)
  410.             last1=lastpos("\", path, last-1)
  411.             new_zone=substr(path, last1+1, (last-last1-1))
  412.             last2=lastpos(".", new_zone)
  413.             if last2\=0 then do
  414.                 new_end=substr(new_zone, last2+1)
  415.                 zone_hold.i=x2d(new_end)
  416.                 domain_hold.i=substr(new_zone, 1, last2-1)
  417.             end            
  418.             new_dir=substr(path, last+1)
  419.             last=lastpos(".", new_dir)
  420.             new_end=substr(new_dir, last+1)
  421.  
  422.             if new_end = "PNT" then do
  423.                net_hold.i=x2d(substr(new_dir,1,4))
  424.                node_hold.i=x2d(substr(new_dir,5,4))
  425.                point_hold.i=x2d(substr(filespec( "N", CR_NM_name.i),5,4))
  426.             end
  427.             else do
  428.                 zone_hold.i=x2d(new_end)
  429.                 domain_hold.i=substr(new_dir, 1, last-1)
  430.                 net_hold.i=x2d(substr(filespec( "N", CR_NM_name.i),1,4))
  431.                 node_hold.i=x2d(substr(filespec( "N", CR_NM_name.i),5,4))
  432.             end
  433.         end
  434.         else do
  435.             net=FILESPEC("N", CR_NM_name.i)
  436.             net=strip(substr(net,1,4),"B")
  437.              node=FILESPEC("N", CR_NM_name.i)
  438.             node=strip(substr(node,5,4),"B")
  439.             net_hold.i=x2d(net)
  440.             node_hold.i=x2d(node)
  441.         end
  442.         CR_NM_out.i="A."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  443.         CR_NM_flavor.i="C."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  444.         say "   ***Creating Outbound "||filespec("N", CR_NM_name.i)||" for "||CR_NM_out.i||" CRASH flavor"
  445.         say ""
  446.     end
  447.  
  448.     do i=1 to CR_NM_array.0
  449.         file=CR_NM_name.i
  450.         filesearch=adept_out||CR_NM_flavor.i
  451.         call SysFileTree filesearch, "flavor.", "FS"
  452.  
  453.         new_name=pkt_name()
  454.         '@ren 'cr_nm_name.i new_name
  455.         '@ZIP.EXE -m -j 'adept_out||cr_nm_out.i path||'\'||new_name
  456.         if flavor.0=0 then do
  457.             say "   *** Creating C-flavor"
  458.             say ""
  459.             rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  460.             rc_close = STREAM( (filesearch) , "C" , "CLOSE" )
  461.         end
  462.     end
  463. end
  464.  
  465.  
  466.  
  467.  
  468. /* FLO ATTACH */
  469.  
  470. if attach_array.0 > 0 then do
  471.     do i=1 to attach_array.0
  472.         attach_name.i=strip(subword(attach_array.i, 5),"B")
  473.         domain_hold.i=default_domain
  474.         zone_hold.i=default_zone
  475.         point_hold.i=default_point
  476.         path=translate(filespec("P", attach_name.i))
  477.         if path\=path_bink then do
  478.             path=strip(path, "T", "\")
  479.             last=lastpos("\", path)
  480.             last1=lastpos("\", path, last-1)
  481.             new_zone=substr(path, last1+1, (last-last1-1))
  482.             last2=lastpos(".", new_zone)
  483.             if last2\=0 then do
  484.                 new_end=substr(new_zone, last2+1)
  485.                 zone_hold.i=x2d(new_end)
  486.                 domain_hold.i=substr(new_zone, 1, last2-1)
  487.             end            
  488.             new_dir=substr(path, last+1)
  489.             last=lastpos(".", new_dir)
  490.             new_end=substr(new_dir, last+1)
  491.  
  492.             if new_end = "PNT" then do
  493.                net_hold.i=x2d(substr(new_dir,1,4))
  494.                node_hold.i=x2d(substr(new_dir,5,4))
  495.                point_hold.i=x2d(substr(filespec( "N", attach_name.i),5,4))
  496.             end
  497.             else do
  498.                 zone_hold.i=x2d(new_end)
  499.                 domain_hold.i=substr(new_dir, 1, last-1)
  500.                 net_hold.i=x2d(substr(filespec( "N", attach_name.i),1,4))
  501.                 node_hold.i=x2d(substr(filespec( "N", attach_name.i),5,4))
  502.             end
  503.         end
  504.         else do
  505.             net=FILESPEC("N", attach_name.i)
  506.             net=strip(substr(net,1,4),"B")
  507.              node=FILESPEC("N", attach_name.i)
  508.             node=strip(substr(node,5,4),"B")
  509.             net_hold.i=x2d(net)
  510.             node_hold.i=x2d(node)
  511.         end
  512.         attach_out.i="A."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  513.         attach_flavor.i="N."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  514.         say "   ***Creating Outbound "||filespec("N", attach_name.i)||" for "||attach_out.i||" HOLD flavor"
  515.         say ""
  516.     end
  517.  
  518.     do i=1 to attach_array.0
  519.         file=attach_name.i
  520.  
  521.         rc_open = STREAM( (file) , "C" , "OPEN" )
  522.         do while lines(file)
  523.             line=linein(file)
  524.             last=lastpos(".", line)
  525.             endung=translate(substr(line, last+1))
  526.             filesearch=adept_out||attach_flavor.i
  527.             call SysFileTree filesearch, "flavor.", "FS"
  528.             say "   *** Creating H-flavor for file attach"
  529.             say ""
  530.             if endung="PKT" then do
  531.                 'ZIP.EXE -m -j 'adept_out||attach_out.i line
  532.                 if flavor.0=0 then do
  533.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  534.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  535.                 end
  536.             end
  537.             else do
  538.                 if flavor.0=0 then do
  539.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  540.                     ok=lineout(filesearch, line)
  541.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  542.                 end
  543.                 else do
  544.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  545.                     rc_seek = STREAM( (filesearch) , "C" , "SEEK <0" )
  546.                     ok=lineout(filesearch, line)
  547.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  548.  
  549.                 end
  550.             end
  551.         end
  552.         rc_open = STREAM( (file) , "C" , "CLOSE" )
  553.         call Sysfiledelete(file)
  554.     end
  555. end
  556.  
  557.  
  558. /* REQUESTS */
  559.  
  560. if request_array.0 > 0 then do
  561.     do i=1 to request_array.0
  562.         request_name.i=strip(subword(request_array.i, 5),"B")
  563.         domain_hold.i=default_domain
  564.         zone_hold.i=default_zone
  565.         point_hold.i=default_point
  566.         path=translate(filespec("P", request_name.i))
  567.         if path\=path_bink then do
  568.             path=strip(path, "T", "\")
  569.             last=lastpos("\", path)
  570.             last1=lastpos("\", path, last-1)
  571.             new_zone=substr(path, last1+1, (last-last1-1))
  572.             last2=lastpos(".", new_zone)
  573.             if last2\=0 then do
  574.                 new_end=substr(new_zone, last2+1)
  575.                 zone_hold.i=x2d(new_end)
  576.                 domain_hold.i=substr(new_zone, 1, last2-1)
  577.             end            
  578.             new_dir=substr(path, last+1)
  579.             last=lastpos(".", new_dir)
  580.             new_end=substr(new_dir, last+1)
  581.  
  582.             if new_end = "PNT" then do
  583.                net_hold.i=x2d(substr(new_dir,1,4))
  584.                node_hold.i=x2d(substr(new_dir,5,4))
  585.                point_hold.i=x2d(substr(filespec( "N", request_name.i),5,4))
  586.             end
  587.             else do
  588.                 zone_hold.i=x2d(new_end)
  589.                 domain_hold.i=substr(new_dir, 1, last-1)
  590.                 net_hold.i=x2d(substr(filespec( "N", request_name.i),1,4))
  591.                 node_hold.i=x2d(substr(filespec( "N", request_name.i),5,4))
  592.             end
  593.         end
  594.         else do
  595.             net=FILESPEC("N", request_name.i)
  596.             net=strip(substr(net,1,4),"B")
  597.              node=FILESPEC("N", request_name.i)
  598.             node=strip(substr(node,5,4),"B")
  599.             net_hold.i=x2d(net)
  600.             node_hold.i=x2d(node)
  601.         end
  602.         request_flavor.i="R."||zone_hold.i||"."||net_hold.i||"."||node_hold.i||"."||point_hold.i||"."||domain_hold.i
  603.         say "   ***Creating Outbound "||filespec("N", request_name.i)||" for "||request_out.i||" REQUEST flavor"
  604.         say ""
  605.     end
  606.  
  607.     do i=1 to request_array.0
  608.         file=request_name.i
  609.  
  610.         rc_open = STREAM( (file) , "C" , "OPEN" )
  611.         do while lines(file)
  612.             line=linein(file)
  613.             last=lastpos(".", line)
  614.             endung=translate(substr(line, last+1))
  615.             filesearch=adept_out||request_flavor.i
  616.             call SysFileTree filesearch, "flavor.", "FS"
  617.             say "   *** Creating R-flavor for file request"
  618.             say ""
  619.                 if flavor.0=0 then do
  620.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  621.                     ok=lineout(filesearch, line)
  622.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  623.                 end
  624.                 else do
  625.                     rc_open = STREAM( (filesearch) , "C" , "OPEN" )
  626.                     rc_seek = STREAM( (filesearch) , "C" , "SEEK <0" )
  627.                     ok=lineout(filesearch, line)
  628.                     rc_open = STREAM( (filesearch) , "C" , "CLOSE" )
  629.  
  630.                 end
  631.         end
  632.         rc_open = STREAM( (file) , "C" , "CLOSE" )
  633.         call Sysfiledelete(file)
  634.     end
  635. end
  636.  
  637.  
  638. say ""
  639. say ""
  640. say center("   *****************************",70)
  641. say center("   * Binkley - Adept Converter *",70)
  642. say center("   *                           *",70)
  643. say center("   *     --==BREAKDOWN==--     *",70)
  644. say center("   *                           *",70)
  645. say center("   *****************************",70)
  646. say center("                          BK'97 ",70)
  647. say ""
  648.  
  649. say "   *** "||hold_array.0||" HLO file(s) found"
  650. say "   *** "||crash_array.0||" CLO file(s) found"
  651. say "   *** "||request_array.0||" REQ file(s)" 
  652. say "   *** "||attach_array.0||" FLO file(s) found"
  653.  
  654. hold=out_nm_array.0+hld_nm_array.0
  655. say "   *** "||hold||" NetMail(s) and "||cr_nm_array.0||" CRASH NetMail(s) found"
  656. say ""
  657. say "   *** DONE!"
  658.  
  659. exit
  660.  
  661. pkt_name:
  662.  
  663.     tage=0
  664.     zeit=0
  665.     new_name=""
  666.  
  667. /* FTS-0009: [MSGID]
  668.    The serial number may be any eight
  669.    character hexadecimal number,  as long as it is unique - no two
  670.    messages from a given system may have the same serial number
  671.    within a three years.  The manner in which this serial number is
  672.    generated is left to the implementor.
  673.  
  674.    NOTE:
  675.    I ve no idea how to make unique for 3 years. i ve decided to make them unique
  676.    for one year - any other test i made would need more than 8 characters.
  677.    Once i can find out the way gatekeeper will name PKTs i will replace this function.
  678. */
  679.     tage=d2x(date("D"))
  680.     zeit=(time("S"))
  681.     zeit=zeit+temp
  682.     zeit=d2x(zeit)
  683.     new_name=tage||zeit
  684.     laenge=length(new_name)
  685.     do a=laenge to 7
  686.         new_name='0'||new_name
  687.     end
  688.     temp=temp+1
  689.     new_name=new_name||'.PKT'
  690. return new_name
  691.  
  692.